﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="resColorScheme.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid Margin="1,0">
                        <Border Name="TabBorder" BorderBrush="{StaticResource brushEditTabBorder}" CornerRadius="6,6,0,0">
                            <ContentPresenter x:Name="ContentSite"
                                  VerticalAlignment="Center" HorizontalAlignment="Center"
                                  ContentSource="Header" Margin="8,2,8,2" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="TabBorder" Property="BorderThickness" Value="1,1,1,0" />
                            <Setter TargetName="TabBorder" Property="Background" Value="{StaticResource brushEditTabSelectedBackground}" />
                            <Setter Property="TextBlock.Foreground" Value="{StaticResource brushEditTabSelectedText}" />
                            <Setter Property="TextBlock.FontWeight" Value="Bold" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter TargetName="TabBorder" Property="BorderThickness" Value="1" />
                            <Setter TargetName="TabBorder" Property="Background" Value="{StaticResource brushEditTabBackground}" />
                            <Setter Property="TextBlock.Foreground" Value="{StaticResource brushEditTabText}" />
                            <Setter Property="TextBlock.FontWeight" Value="Normal" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="{x:Type TabControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        
                        <!-- Strip containing tabs -->
                        <TabPanel Grid.Row="0" Panel.ZIndex="1" Margin="10,0,4,-1" IsItemsHost="True" Background="Transparent" />
                        
                        <!-- Tab content display area -->
                        <Border Grid.Row="1" BorderBrush="{StaticResource brushEditTabBorder}" CornerRadius="12"
                                BorderThickness="1" Background="{StaticResource brushEditTabPanelBackground}" >
                            <ContentPresenter ContentSource="SelectedContent" />
                        </Border>
                        
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>